home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / flex_247.zip / flex_247 / MISC / MSDOS / MSDOS.notes2 < prev    next >
Text File  |  1990-07-10  |  9KB  |  286 lines

  1. (Message inbox:26)
  2. Date:  Tue, 10 Jul 90 15:34:06 -0700
  3. From:  "Peter Bigot" <pab@cs.arizona.edu>
  4. Subject:  Re: Flex 2.3 on MSDOS
  5. To:  pab@cs.arizona.edu, vern@cs.cornell.edu
  6.  
  7. >> I seem to have succeeded in porting Flex 2.3 to MS-DOS, using the Microsoft 
  8. C
  9. >> ...
  10. >
  11. >Are your changes with respect to the Makefile.Microsoft in the flex/MISC/
  12. >directory?  If so, yes, please send them so I can incorporate them for
  13. >the 2.4 release.
  14.  
  15. Actually, they're a rewrite of the Makefile in flex/.  I've appended a copy of
  16. it, with assorted comments built in, to the end of this message.  Anybody who
  17. tries to build it will probably have to make some of the other changes I
  18. mentioned as well.
  19.  
  20. If you'll let me know just before you release 2.4, I can do a final port and
  21. change list then.  I assume it isn't imminent.
  22.  
  23. The MSC 6.0 register error is too complex to get rid of that easily.  For the
  24. moment, my scanners aren't time-critical, so I'll just keep #define'ing
  25. register; I don't want to have to remove the register storage class specifiers
  26. one-by-one until I find a permutation which works.
  27.  
  28. By the way, this point:
  29. >- Changed arguments to allocate_array and reallocate_array to unsigned ints,
  30. >  and changed 16bit check to ((long)(element_size * size) > 0xFFFF), to handle
  31. >  allocations between 32768 and 65535.
  32. was wrong.  It handled the particular case I needed where the allocation was
  33. greater than 32768, but it won't catch actual overflow.  The correct
  34. comparison should be:
  35.         (((long) element_size * size) > 0xFFFFL)
  36.  
  37. Peter
  38. --------------------------------------------------
  39. # make file for "flex" tool
  40.  
  41. # @(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/Makefile,v 2.9 90/05/26 17:28:44
  42.  vern Exp $ (LBL)
  43.  
  44. # Modified Tuesday, July 10, 1990, at 4:16p
  45. # This version is compatible with Microsoft C 6.0 and its near-Unix
  46. # compatible make facility 'nmake'.  Lines beginning with #& do not have
  47. # application to MSDOS systems, and are ignored.
  48. # Some changes to various source files, documented in changes.dos, may
  49. # also need to be made.
  50. # You'll also need the flex.lnk file, a copy of which appears at the end of
  51. # this file.
  52. # When running bigtest, expect the -C, -Cf, and -CF tests to fail--there 
  53. # isn't enough memory to form the scanner tables.
  54. # Note: I used a ported version of Bison 1.11, renamed to yacc.  With luck,
  55. # this will soon be available for anonymous ftp from cs.arizona.edu.
  56. # Peter A. Bigot
  57. # pab@cs.arizona.edu
  58.  
  59. # Porting considerations:
  60. #
  61. #    For System V Unix machines, add -DUSG to CFLAGS (if it's not
  62. #         automatically defined)
  63. #    For Vax/VMS, add "-DVMS -DUSG" to CFLAGS.
  64. #    For MS-DOS, add "-DMS_DOS -DUSG" to CFLAGS.  Create \tmp if not present.
  65. #         You will also want to rename flex.skel to something with a three
  66. #         character extension, change SKELETON_FILE below appropriately,
  67. #          See MSDOS.notes for more info.
  68. #    For Amiga, add "-DAMIGA -DUSG" to CFLAGS.
  69. #    For SCO Unix, add "-DSCO_UNIX" to CFLAGS.
  70. #
  71. #    For C compilers which don't know about "void", add -Dvoid=int to CFLAGS.
  72. #
  73. #    If your C compiler is ANSI standard but does not include the <stdlib.h>
  74. #    header file (some installations of gcc have this problem), then add
  75. #    -DDONT_HAVE_STDLIB_H to CFLAGS.
  76. #
  77. # By default, flex will be configured to generate 8-bit scanners only
  78. # if the -8 flag is given.  If you want it to always generate 8-bit
  79. # scanners, add "-DDEFAULT_CSIZE=256" to CFLAGS.  Note that doing
  80. # so will double the size of all uncompressed scanners.
  81. # If on your system you have trouble building flex due to 8-bit
  82. # character problems, remove the -8 from FLEX_FLAGS and the
  83. # "#define FLEX_8_BIT_CHARS" from the beginning of flexdef.h.
  84.  
  85.  
  86. # the first time around use "make first_flex"
  87.  
  88.  
  89. # Installation targeting.  Files will be installed under the tree rooted
  90. # at DESTDIR.  User commands will be installed in BINDIR, library files
  91. # in LIBDIR (which will be created if necessary), auxiliary files in
  92. # AUXDIR, manual pages will be installed in MANDIR with extension MANEXT.
  93. # Raw, unformatted troff source will be installed if INSTALLMAN=man, nroff
  94. # preformatted versions will be installed if INSTALLMAN=cat.
  95. DESTDIR = c:\\
  96. BINDIR = 
  97. LIBDIR = lib
  98. AUXDIR = lib
  99. #& MANDIR = /usr/man/manl
  100. #& MANEXT = l
  101. #& INSTALLMAN = man
  102.  
  103. MAKE = nmake
  104.  
  105. # .c.obj:
  106. #         $(CC) -c $(CFLAGS) $<
  107.  
  108. SKELETON_FILE = $(DESTDIR)$(AUXDIR)\\flex.ske
  109. SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_FILE)\"
  110. # Large memory model, initialized data larger than 16k gets its
  111. # own segment, set ANSI mode, define USG and MS_DOS.
  112. CFLAGS = -AL -Gt16384 -Za -DUSG -DMS_DOS
  113. LDFLAGS =
  114.  
  115. COMPRESSION =
  116. FLEX_FLAGS = -ist8 -Sflex.ske
  117. # which "flex" to use to generate scan.c from scan.l
  118. FLEX = .\flex
  119. CC = cl
  120.  
  121. #& AR = ar
  122. #& RANLIB = ranlib
  123.  
  124. FLEXOBJS = \
  125.         ccl.obj \
  126.         dfa.obj \
  127.         ecs.obj \
  128.         gen.obj \
  129.         main.obj \
  130.         misc.obj \
  131.         nfa.obj \
  132.         parse.obj \
  133.         scan.obj \
  134.         sym.obj \
  135.         tblcmp.obj \
  136.         yylex.obj
  137.  
  138. FLEX_C_SOURCES = \
  139.         ccl.c \
  140.         dfa.c \
  141.         ecs.c \
  142.         gen.c \
  143.         main.c \
  144.         misc.c \
  145.         nfa.c \
  146.         parse.c \
  147.         scan.c \
  148.         sym.c \
  149.         tblcmp.c \
  150.         yylex.c
  151.  
  152. FLEX_LIB_OBJS = \
  153.         libmain.obj
  154.  
  155. #& FLEXLIB = flexlib.a
  156. FLEXLIB = flexlib.lib
  157.  
  158. all : flex.exe $(FLEXLIB)
  159.  
  160. flex.exe : $(FLEXOBJS)
  161.         link @flex.lnk
  162. #        $(CC) $(CFLAGS) -Feflex $(LDFLAGS) $(FLEXOBJS)
  163.  
  164.  
  165. first_flex:
  166.         copy initscan.c scan.c
  167.         $(MAKE) $(MFLAGS) flex.exe
  168.  
  169. parse.h parse.c : parse.y
  170.         yacc -d parse.y
  171.         del parse.c
  172.         del parse.h
  173.         ren y_tab.c parse.c
  174.         ren y_tab.h parse.h
  175.  
  176. scan.c : scan.l
  177.         $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c
  178.  
  179. scan.obj : scan.c parse.h flexdef.h
  180.  
  181. main.obj : main.c flexdef.h
  182.         $(CC) $(CFLAGS) -c $(SKELFLAGS) main.c
  183.  
  184. ccl.obj : ccl.c flexdef.h
  185. dfa.obj : dfa.c flexdef.h
  186. ecs.obj : ecs.c flexdef.h
  187. gen.obj : gen.c flexdef.h
  188. misc.obj : misc.c flexdef.h
  189. nfa.obj : nfa.c flexdef.h
  190. parse.obj : parse.c flexdef.h
  191. sym.obj : sym.c flexdef.h
  192. tblcmp.obj : tblcmp.c flexdef.h
  193. yylex.obj : yylex.c flexdef.h
  194.  
  195. #& flex.man : flex.1
  196. #&         nroff -man flex.1 >flex.man
  197.  
  198. $(FLEXLIB) : $(FLEX_LIB_OBJS)
  199.         lib flexlib -+libmain ;
  200. #&         $(AR) cru $(FLEXLIB) $(FLEX_LIB_OBJS)
  201.  
  202. #& 
  203. #& lint : $(FLEX_C_SOURCES)
  204. #&         lint $(FLEX_C_SOURCES) > flex.lint
  205. #& 
  206. #& distrib :
  207. #&         mv scan.c initscan.c
  208. #&         chmod 444 initscan.c
  209. #&         $(MAKE) $(MFLAGS) clean
  210. #& 
  211. #& install: flex $(DESTDIR)$(LIBDIR) flex.skel install.$(INSTALLMAN) install-li
  212. b
  213. #&         install -s -m 755 flex $(DESTDIR)$(BINDIR)/flex
  214. #&         install -c -m 644 flex.skel $(SKELETON_FILE)
  215. #& 
  216. #& install-lib: $(DESTDIR)$(LIBDIR) $(FLEXLIB)
  217. #&         install -c -m 644 $(FLEXLIB) $(DESTDIR)$(LIBDIR)/libfl.a
  218. #&         $(RANLIB) $(DESTDIR)$(LIBDIR)/libfl.a
  219. #& 
  220. #& $(DESTDIR)$(LIBDIR):
  221. #&         mkdir $@
  222. #& 
  223. #& install.man: flex.1 flexdoc.1
  224. #&         install -c -m 644 flex.1 $(DESTDIR)$(MANDIR)/flex.$(MANEXT)
  225. #&         install -c -m 644 flexdoc.1 $(DESTDIR)$(MANDIR)/flexdoc.$(MANEXT)
  226. #& 
  227. #& install.cat: flex.1 flexdoc.1
  228. #&         nroff -h -man flex.1 > $(DESTDIR)$(MANDIR)/flex.$(MANEXT)
  229. #&         nroff -h -man flexdoc.1 > $(DESTDIR)$(MANDIR)/flexdoc.$(MANEXT)
  230. #&         chmod 644 $(DESTDIR)$(MANDIR)/flex.$(MANEXT)
  231. #&         chmod 644 $(DESTDIR)$(MANDIR)/flexdoc.$(MANEXT)
  232. #& 
  233. #& clean :
  234. #&         rm -f core errs flex *.obj parse.c *.lint parse.h flex.man tags \
  235. #&                 $(FLEXLIB)
  236. #& 
  237. #& tags :
  238. #&         ctags $(FLEX_C_SOURCES)
  239. #& 
  240. #& vms :        flex.man
  241. #&         $(MAKE) $(MFLAGS) distrib
  242.  
  243. test : flex.exe
  244. #&         .\flex $(FLEX_FLAGS) $(COMPRESSION) scan.l | diff scan.c -
  245.         .\flex $(FLEX_FLAGS) $(COMPRESSION) scan.l > scan.res
  246. # Crude comparison; use diff or compare if you've got working versions.
  247.         comp scan.res scan.c
  248.  
  249. bigtest :
  250. #& The two resident nmake's do not leave enough memory to complete -C, -Cf,
  251. #& or -CF.  But hey, give 'em a try.
  252.         del scan.c 
  253.         $(MAKE) COMPRESSION="-C" test
  254.         del scan.c 
  255.         $(MAKE) COMPRESSION="-Ce" test
  256.         del scan.c 
  257.         $(MAKE) COMPRESSION="-Cm" test
  258.         del scan.c 
  259.         $(MAKE) COMPRESSION="-Cfe" test
  260.         del scan.c 
  261.         $(MAKE) COMPRESSION="-CFe" test
  262.         del scan.c 
  263.         $(MAKE) COMPRESSION="-Cf" test
  264.         del scan.c 
  265.         $(MAKE) COMPRESSION="-CF" test
  266.         del scan.c
  267.         $(MAKE)
  268.  
  269. # --------------------
  270. # The contents of flex.lnk are:
  271. # ccl.obj+
  272. # dfa.obj+
  273. # ecs.obj+
  274. # gen.obj+
  275. # main.obj+
  276. # misc.obj+
  277. # nfa.obj+
  278. # parse.obj+
  279. # scan.obj+
  280. # sym.obj+
  281. # tblcmp.obj+
  282. # yylex.obj
  283. # flex.exe /exepack/farcall/noi/stack:0x3000 ;
  284.